import { base } from '@/config'
import http from '@/utils/request'

// 广告弹窗
const popupApi = {
  // 添加
  addPopup: params => {
    return http.postJson(`${base.advert}/advertWindows/add`, params)
  },
  // 编辑
  updatePopup: params => {
    return http.postJson(`${base.advert}/advertWindows/edit`, params)
  },
  // 删除
  deletePopup: id => {
    return http.postJson(`${base.advert}/advertWindows/remove/${id}`)
  },
  // 获取详情
  getPopupDetail: id => {
    return http.get(`${base.advert}/advertWindows/${id}`)
  },
  // 显示，隐藏
  updateStatus: params => {
    return http.postJson(`${base.advert}/advertWindows/edit/isShow`, params)
  },
  // 获取列表
  getPopupList: params => {
    return http.get(`${base.advert}/advertWindows/list`, params)
  }
}

export default popupApi
